package com.ytxg.home.controller;

import com.ytxg.home.dto.HomeBookRespDto;
import com.ytxg.core.dto.RestResp;
import com.ytxg.home.service.IFriendLinkService;
import com.ytxg.home.service.IHomeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 小说推荐 前端控制器
 * </p>
 *
 * @author YT_XG
 * @since 2023-12-17
 */
@RestController
@RequestMapping("/api/front/home")
public class HomeBookController {

    @Resource
    private IHomeService iHomeService;
    @Resource
    private IFriendLinkService iFriendLinkService;

    @GetMapping("books")
    public RestResp<List<HomeBookRespDto>> books() {
        RestResp<List<HomeBookRespDto>> listRestResp = iHomeService.listHomeBooks();

        return listRestResp;
    }

    @GetMapping("friend_Link/list")
    public RestResp friendLink() {

        RestResp<List> getlist = iFriendLinkService.getlist();
        return getlist;

    }
}
